"""
    连接数据库的步骤
    1. 导入需要的包
        1. mysql-connector
        2. mysql-connector-python
    2. 配置连接

"""
import mysql.connector

from com.hanamaki.study.db.util import JDBCUtils


def test_sql():
    con = JDBCUtils.get_con()
    print(con)
    sql = "select * from students"
    cursor = con.cursor()
    cursor.execute(sql)
    values = cursor.fetchall()
    cursor.close()
    con.close()
    return values


if __name__ == '__main__':
    test_sql()
